#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <ctype.h>

int main ()
{
	int slov=0, strok=0, simvolov=0;
	FILE *file;
	char b = ' ';
	file = fopen ("filename.txt", "r");

	while (1)
	{
		int a = fgetc(file);
		if (a == '\n')
			strok++;

		if (a == EOF)
			break;
		simvolov++;

		if (!isspace(a) && isspace(b) )
			slov++;
		b=a;
	}

	if (strok==0 && simvolov != 0)
		strok=1;
	printf("V faile %d slov, %d strok, %d simvolov \n", slov, strok, simvolov);

	fclose(file);
	system ("PAUSE");
}